<?php

/**
 * Description of LibertAPIWrapper
 *    
 * @author Ho Huu Tai <hohuutai.uns@gmail.com>
 */
require_once 'liberty_api/ApiAgent.php';
class LibertAPIWrapper
{
    private $apiAgent;
    
    function __construct()
    {

        $auth = new Authentication(Constant::LR_ACC_ID, Constant::LR_API_NAME, Constant::LR_API_SECUREWORD);
        $this->apiAgent = ApiAgentFactory::createApiAgent(ApiAgentFactory::XML, $auth);
    }
    
    function checkLiberyAccountExist($accountToRetrieve)
    {
        if($this->apiAgent->accountName($accountToRetrieve))
        {
            return TRUE;
        }
        else
        {
            return FALSE;;
        }
    }
    
    function sendmoney($payee, $currency, $amount, $private, $purpose, $ref="", $memo="chuyen tien tu viet lo de")
    {
    	return $this->apiAgent->transfer($payee, $currency, $amount, $private, $purpose,$ref,$memo);
    }
    
    function showmoney($currency)
    {
    	return $this->apiAgent->balance($currency);
    }
}

?>
